package cn.santi.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 
 * @TableName a_coupon
 */
@TableName(value ="a_coupon")
@Data
public class coupon implements Serializable {
    /**
     * 优惠卷id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 优惠卷名称
     */
    private String yname;

    /**
     * 使用范围
     */
    private String scope;

    /**
     * 有效期
     */
    private String validity;

    /**
     * 原价
     */
    private BigDecimal orginprice;

    /**
     * 打折价
     */
    private BigDecimal price;

    /**
     * 状态（0启1停）
     */
    private String state;

    /**
     * 值
     */
    private Integer val;

    /**
     * 门店id
     */
    private Integer bid;
    /**
     * 可购买次数
     */
    private Integer size;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        coupon other = (coupon) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getYname() == null ? other.getYname() == null : this.getYname().equals(other.getYname()))
            && (this.getScope() == null ? other.getScope() == null : this.getScope().equals(other.getScope()))
            && (this.getValidity() == null ? other.getValidity() == null : this.getValidity().equals(other.getValidity()))
            && (this.getOrginprice() == null ? other.getOrginprice() == null : this.getOrginprice().equals(other.getOrginprice()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getVal() == null ? other.getVal() == null : this.getVal().equals(other.getVal()))
            && (this.getBid() == null ? other.getBid() == null : this.getBid().equals(other.getBid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getYname() == null) ? 0 : getYname().hashCode());
        result = prime * result + ((getScope() == null) ? 0 : getScope().hashCode());
        result = prime * result + ((getValidity() == null) ? 0 : getValidity().hashCode());
        result = prime * result + ((getOrginprice() == null) ? 0 : getOrginprice().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getVal() == null) ? 0 : getVal().hashCode());
        result = prime * result + ((getBid() == null) ? 0 : getBid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", yname=").append(yname);
        sb.append(", scope=").append(scope);
        sb.append(", validity=").append(validity);
        sb.append(", orginprice=").append(orginprice);
        sb.append(", price=").append(price);
        sb.append(", state=").append(state);
        sb.append(", val=").append(val);
        sb.append(", bid=").append(bid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}